﻿@{
    ViewBag.Title = "添加";
    Layout = "../Shared/_Layout.cshtml";
}
@using mscook.mvc;
@model mscook.core.domain.Hotel

@section JavaScript
{
    <script type="text/javascript" src="@Url.Content("~/scripts/jquery.validate.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/scripts/jquery.validate.unobtrusive.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/scripts/jquery.unobtrusive-ajax.js")"></script>
    <script type="text/javascript">
        $("#IsShowOnBottom").change(function () {
            var checkValue = $("#IsShowOnBottom").val();
            if (checkValue == "true") {
                $("#bottomImageUpload").show();
            } else {
                $("#bottomImageUpload").hide();
            }
        });
    </script>
}
@Html.Partial("_MultiBtnModalLoder")
<div id="resourceTypeModal" class=" modal hide fade form-horizontal">
</div>
<div class="row-fluid sortable">
    <div class="box span12">
        <div class="box-header well">
            <h2><i class="icon-edit"></i>Form Elements</h2>
            <div class="box-icon">
                <a href="@Url.Action("Add")" class="btn btn-setting btn-round"><i class="icon-plus-sign"></i></a>
            </div>
        </div>
        <div class="box-content">
            @using (Html.BeginForm("Add", "Hotel", FormMethod.Post, new { @class = "form-horizontal", enctype = "multipart/form-data" }))
            {
                <fieldset>
                    <legend>酒店增加</legend>
                    <div class="control-group">
                        <label class="control-label">酒店名</label>
                        <div class="controls">
                            <div class="input-prepend">
                                @Html.TextBoxFor(Hotel => Hotel.Name, new { size = "16" })
                            </div>
                            @Html.ValidationMessageFor(Hotel => Hotel.Name)
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">联系方式</label>
                        <div class="controls">
                            <div class="input-prepend">
                                @Html.TextBoxFor(Hotel => Hotel.PhoneNum, new { size = "16" })
                            </div>
                            @Html.ValidationMessageFor(Hotel => Hotel.PhoneNum)
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">合作酒店</label>
                        <div class="controls">
                            <div class="input-prepend">
                                @{
                var itemList = new List<SelectListItem>();
                itemList.Add(new SelectListItem() { Text = "是", Value = "true", Selected = true });
                itemList.Add(new SelectListItem() { Text = "否", Value = "false", Selected = false });
                                    @Html.DropDownListFor(Hotel => Hotel.IsPartner, itemList);
                                       
                                }
                            </div>
                            @Html.ValidationMessageFor(Hotel => Hotel.IsPartner)
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">置顶</label>
                        <div class="controls">
                            <div class="input-prepend">
                                <select id="IsTop" name="IsTop">
                                    <option value="false" selected="selected">否</option>
                                    <option value="true">是</option>
                                </select>
                            </div>

                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">地址</label>
                        <div class="controls">
                            <div class="input-prepend">
                                @Html.TextBoxFor(Hotel => Hotel.Address, new { size = "16" })
                            </div>
                            @Html.ValidationMessageFor(Hotel => Hotel.Address)
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">责任编辑</label>
                        <div class="controls">
                            <div class="input-prepend">
                                @Html.TextBoxFor(Hotel => Hotel.Editor, new { size = "16" })
                            </div>
                            @Html.ValidationMessageFor(Hotel => Hotel.Editor)
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">类型</label>
                        <div class="controls">
                            <div class="input-prepend">
                                @Html.TextBox("HotelTypeName", "", new { @readonly = "true" })
                                @Html.Hidden("HotelTypeId")
                            </div>
                            <button id="resourceTypeModalBtn" type="button" class="btn btn-primary multimodalLoder" data-num="1" data-link-name="HotelTypeName" data-link-id="HotelTypeId" data-link-modal="resourceTypeModal" data-type="Hotel" data-url="/weblogin/resourcetype/MultiResourceTypeModal"><i class="icon-edit icon-white"></i></button>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">简介</label>
                        <div class="controls">
                            <div class="input-prepend">
                                @Html.TextAreaFor(Hotel => Hotel.Summary, new { rows = "10", size = "16", @class = "cleditor" })
                            </div>
                            @Html.ValidationMessageFor(Hotel => Hotel.Summary)
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">描述</label>
                        <div class="controls">
                            <div class="input-prepend">
                                @Html.TextAreaFor(Hotel => Hotel.Description, new { rows = "3", @class = "cleditor" })

                            </div>
                            @Html.ValidationMessageFor(Hotel => Hotel.Description)
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">图片</label>
                        <div class="controls">
                            <div class="input-prepend" style="width: 400px">
                                <img id="preview" style="display: none; width: 100%" />
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">图片上传</label>
                        <div class="controls">
                            <div class="fileupload fileupload-new" data-provides="fileupload">
                                <span class="btn btn-file">
                                    <span class="fileupload-new">请选择图片</span>
                                    <span class="fileupload-exists">更改图片</span>
                                    <input name="related_content_image[0]" type="file" />
                                </span>
                                <span class="fileupload-preview"></span>
                                <a href="#" class="close fileupload-exists" data-dismiss="fileupload" style="float: none">×</a>
                            </div>
                        </div>
                    </div>
                      <div class="control-group">
                        <label class="control-label">在首页底部显示</label>
                        <div class="controls">
                            <div class="input-prepend">
                                @{
                var tempItemList = new List<SelectListItem>();
                tempItemList.Add(new SelectListItem() { Text = "是", Value = "true", Selected = false });
                tempItemList.Add(new SelectListItem() { Text = "否", Value = "false", Selected = true });
                                    @Html.DropDownListFor(Hotel => Hotel.IsShowOnBottom, tempItemList);
                                       
                                }
                            </div>
                            @Html.ValidationMessageFor(Hotel => Hotel.IsShowOnBottom)
                        </div>
                    </div>
                    <div id="bottomImageUpload" class="control-group" style="display:none">
                        <label class="control-label">首页底部酒店图片上传</label>
                        <div class="controls">
                            <div class="fileupload fileupload-new" data-provides="fileupload">
                                <span class="btn btn-file">
                                    <span class="fileupload-new">请选择图片</span>
                                    <span class="fileupload-exists">更改图片</span>
                                    <input name="related_content_image[1]" type="file" />
                                </span>
                                <span class="fileupload-preview"></span>
                                <a href="#" class="close fileupload-exists" data-dismiss="fileupload" style="float: none">×</a>
                            </div>
                        </div>
                    </div>
                    <div class="form-actions">
                        <button type="submit" class="btn btn-primary">保存</button>
                        <button class="btn">Cancel</button>
                    </div>
                </fieldset>
            }
        </div>
    </div>
    <!--/span-->

</div>
